package com.cmwa.solution.sys.permission.authority.entity;

import org.apache.ibatis.type.Alias;

import com.cmwa.solution.base.entity.BaseVo;
import com.cmwa.solution.sys.permission.dataAuthority.entity.AuthorityEnum;

/** 
 * @author  zhengqq
 * @date 创建时间：2018-09-04
 * @description 权限控制相关表
 */
@Alias("authorityVo")
public class AuthorityVo extends BaseVo{
	
	/**
	 * 权限类型(1:普通,2:特殊)
	 */
	private String authorityType;
	
	/**
	 * 角色ID
	 */
	private String roleId;
	
	/**
	 * 角色类型
	 */
	private String roleType;
	
	/**
	 * 条数
	 */
	private String rowCount;
	
	/**
	 * 资源ID
	 */
	private String resourceId;
	
	/**
	 * 资源类型
	 */
	private String resourceType;
	
	/**
	 * 项目经理Id
	 */
	private String mgrId;
	
	/**
	 * 部门ID
	 */
	private String orgId;
	
	/**
	 * 员工ID
	 */
	private String empId;
	
	/**
	 * 岗位代码
	 */
	private String postCode;
	
	/**
	 * 资源名称
	 */
	private String resourceName;
	
	/**
	 * 按钮代码
	 */
	private String mcode;
	
	/**
	 * 赋权的方式
	 */
	private AuthorityEnum empowermentWay;
	
	public AuthorityVo() {}
	
	public AuthorityVo(String roleType, String resourceId,String resourceType, String orgId, String empId,
			String postCode, AuthorityEnum empowermentWay) {
		super();
		this.roleType = roleType;
		this.resourceId = resourceId;
		this.resourceType = resourceType;
		this.orgId = orgId;
		this.empId = empId;
		this.postCode = postCode;
		this.empowermentWay = empowermentWay;
	}
	
	public static AuthorityVo.Builder builder() {
		return new Builder();
	}

	public static class Builder {
		/**
		 * 资源ID
		 */
		private String resourceId;
		
		/**
		 * 资源类型
		 */
		private String resourceType;
		
		/**
		 * 部门ID
		 */
		private String orgId;
		
		/**
		 * 员工ID
		 */
		private String empId;
		
		/**
		 * 岗位代码
		 */
		private String postCode;
		
		/**
		 * 角色类型
		 */
		private String roleType;
		
		/**
		 * 赋权的方式
		 */
		private AuthorityEnum empowermentWay;

		public Builder setResourceId(String resourceId) {
			this.resourceId = resourceId;
			return this;
		}
		
		public Builder setResourceType(String resourceType) {
			this.resourceType = resourceType;
			return this;
		}

		public Builder setOrgId(String orgId) {
			this.orgId = orgId;
			return this;
		}

		public Builder setEmpId(String empId) {
			this.empId = empId;
			return this;
		}

		public Builder setPostCode(String postCode) {
			this.postCode = postCode;
			return this;
		}

		public Builder setRoleType(String roleType) {
			this.roleType = roleType;
			return this;
		}

		public Builder setEmpowermentWay(AuthorityEnum empowermentWay) {
			this.empowermentWay = empowermentWay;
			return this;
		}
		
		public AuthorityVo build() {
			return new AuthorityVo(roleType, resourceId,resourceType, orgId, empId, postCode, empowermentWay);
		}
	}
	
	public String getEmpId() {
		return empId;
	}

	public void setEmpId(String empId) {
		this.empId = empId;
	}

	public String getAuthorityType() {
		return authorityType;
	}

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	public void setAuthorityType(String authorityType) {
		this.authorityType = authorityType;
	}

	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	public String getRoleType() {
		return roleType;
	}

	public void setRoleType(String roleType) {
		this.roleType = roleType;
	}


	public String getRowCount() {
		return rowCount;
	}

	public void setRowCount(String rowCount) {
		this.rowCount = rowCount;
	}

	/**
	 * @return the mgrId
	 */
	public String getMgrId() {
		return mgrId;
	}

	/**
	 * @param mgrId the mgrId to set
	 */
	public void setMgrId(String mgrId) {
		this.mgrId = mgrId;
	}

	public String getPostCode() {
		return postCode;
	}

	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	public String getResourceName() {
		return resourceName;
	}

	public void setResourceName(String resourceName) {
		this.resourceName = resourceName;
	}
	
	public String getMcode() {
		return mcode;
	}

	public void setMcode(String mcode) {
		this.mcode = mcode;
	}
	
	public AuthorityEnum getEmpowermentWay() {
		return empowermentWay;
	}

	public void setEmpowermentWay(AuthorityEnum empowermentWay) {
		this.empowermentWay = empowermentWay;
	}
	
	public String getResourceId() {
		return resourceId;
	}

	public void setResourceId(String resourceId) {
		this.resourceId = resourceId;
	}

	public String getResourceType() {
		return resourceType;
	}

	public void setResourceType(String resourceType) {
		this.resourceType = resourceType;
	}

	@Override
	public String toString() {
		return "AuthorityVo [authorityType=" + authorityType + ", roleId="
				+ roleId + ", roleType=" + roleType + ", resourceId=" + resourceId
				+ ", resourceType="+ resourceType +", mgrId=" + mgrId + ", orgId="
				+ orgId + ", empId=" + empId + ", postCode=" + postCode
				+ ", resourceName=" + resourceName + ", mcode=" + mcode
				+ ", empowermentWay=" + empowermentWay + "]";
	}
	
}
